﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text;
using Pahan.McuFusion.Common;
using Pahan.McuFusion.Common.Serialization;

namespace Pahan.McuFusion.Atmel.AVR
{
    [Serializable]
    [DeviceInfoSurrogate(typeof(AvrMcuInfoSurrogate))]
    public class AvrMcuInfo : DeviceInfo
    {
        #region Construction and Initialization

        internal AvrMcuInfo(String model, byte[] modelCode, params MemoryClassInfo[] memory)
        {
            this.model = model;
            this.modelCode = modelCode;
            this.memory = new ReadOnlyCollection<MemoryClassInfo>(memory);
        }

        #endregion

        #region Overrides of DeviceInfo

        public sealed override string Vendor
        {
            get
            {
                return "Atmel";
            }
        }

        public sealed override string Model
        {
            get
            {
                return model;
            }
        }

        public override IList<MemoryClassInfo> Memory
        {
            get
            {
                return memory;
            }
        }

        #endregion

        #region Private Members

        private readonly String model;

        private readonly IList<MemoryClassInfo> memory;

        private readonly byte[] modelCode;

        #endregion
    }
}
